package com.wjy.icu.common.enums;

public enum SystemTreatTypeEnum {

    MEDICAL_RECORD(1,"病历"),
    LABORATORY_REPORT(2,"化验单"),
    DIGITAL_IMAGE(3,"数字影像"),
    PRESCRIPTION(4,"处方单"),
    OPERATION(5,"手术照片"),
    PAYMENT(6,"缴费清单小票"),
    INVOICE(7,"发票"),
    OTHERS(8,"其他");




    private int code;
    private String msg;

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }

    SystemTreatTypeEnum(int code, String value ) {
        this.msg = value;
        this.code = code;
    }
    // 此方法是关键
    public static SystemTreatTypeEnum getByCode(Integer code) {
        for (SystemTreatTypeEnum rebateItemTypeEnum : values()) {
            if (rebateItemTypeEnum.getCode()==code) {
                return rebateItemTypeEnum;
            }
        }
        return null;
    }
    // 此方法是关键
    public static SystemTreatTypeEnum getByValue(String value) {
        for (SystemTreatTypeEnum rebateItemTypeEnum : values()) {
            if (rebateItemTypeEnum.getMsg().equals(value)) {
                return rebateItemTypeEnum;
            }
        }
        return null;
    }
}
